package com.teira.rhrrealstate.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

@Entity
public class Propiedad implements Serializable
{

	private Long id;
	private String descripcion;
	
	@Id 
	@SequenceGenerator(name="my_seq", sequenceName="PROPIEDAD_SEQ")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="my_seq")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Length(max=50) @NotNull
	public String getDescripcion() {
		return descripcion;
	}
	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(this.id).append(this.descripcion).toHashCode();
	}
	
	
}
